import 'package:flutter/material.dart';

class ScreenUtil {
  static final MediaQueryData _mediaQueryData =
      MediaQueryData.fromView(WidgetsBinding.instance.platformDispatcher.views.single);

  /// 屏幕宽度
  static double get width => _mediaQueryData.size.width;

  /// 屏幕高度
  static double get height => _mediaQueryData.size.height;

  /// 状态栏高度
  static double get statusBarH => _mediaQueryData.padding.top;

  /// 导航栏高度
  static double get navBarH => kToolbarHeight;

  /// 状态栏高度 + 导航栏高度
  static double get appBarH => statusBarH + navBarH;

  /// 底部安全区高度
  static double get bottomSafeH => _mediaQueryData.padding.bottom;

  /// tabBar高度
  static double get tabBarH => kBottomNavigationBarHeight;
}
